<template>
    <div class="vipIndex">
        <el-container>
        <el-aside width="200px">
            <el-menu :router="true">
            <el-submenu index="1">
                <template slot="title">
                    <i class="el-icon-message"></i> <span>自定义流程</span>
                </template>
                <el-menu-item :index="'/index'">获取token</el-menu-item>
                <el-menu-item-group title="org">
                <el-menu-item :index="'/index/org/DutyList'+querys">职位管理</el-menu-item>
                <el-menu-item :index="'/index/org/UserInfo'+querys">个人信息</el-menu-item>
                </el-menu-item-group>
            </el-submenu>
            </el-menu>
        </el-aside>
        <el-main>
            <router-view></router-view>
        </el-main>
        </el-container>
    </div>
</template>

<script>
import {GetRequestParams,toJson} from "@/utils/utils.js";
export default {
    data() {
        return {
            token:"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiI1MDYxN0EwMi1FNEQ0LTQ0ODctOUU0MS1BQjZGQ0U5RDNEMjV8MjFBRjY5MTQtQzY3OS00MjY0LTkxNjEtRDMzM0E2OUVEMzVDfG93biIsImlhdCI6MTYwNDExMzU0OCwiZXhwIjoxNjA0MTMxNTQ4fQ.XrdqA6ZMKYGHzswGUBcNMQGs1IJEnxL8vpeGGjwhl9UM-ozqBAWKCNeneheXs-Qmthu5p5I_MKyrdfwlSAH3tg",
			userid:"50617A02-E4D4-4487-9E41-AB6FCE9D3D25",
            comid:"21af6914-c679-4264-9161-d333a69ed35c",
            querys:"",
            username:'jzb0710',
            password:'123456',
        };
    },
    mounted() {
        this.querys="?userid="+this.userid+"&comid="+this.comid+"&token="+this.token;
        if(GetRequestParams().username) this.username = GetRequestParams().username;
        if(GetRequestParams().password) this.password = GetRequestParams().password;
        this.getToken();
    },
    methods: {
        getToken(){
            this.$post('/org/auth/loginByPwd',{username:this.username,password:this.password})
            .then(resp=>{
                if(resp.code == '30000'){
                    this.token = resp.token;
                    this.userid = resp.userId;
                    this.comid = resp.comId;
                    this.querys="?userid="+this.userid+"&comid="+this.comid+"&token="+this.token;
                }
            })
        }
    }
};
</script>
<style lang="less" scoped>
@import "~@/assets/style/base.css";
.el-header,
.el-aside,
.el-main,
.el-footer {
  padding: 0;
}
.el-container {
  width: 100%;
  height: 100vh;
}
.el-main {
  overflow: hidden;
  width: calc(100vw - 200px);
}
</style>